fix(cmake): move GNUInstallDirs include into cet_cmake_env macro#40
Open
greenc-FNAL wants to merge 1 commit into
Open
fix(cmake): move GNUInstallDirs include into cet_cmake_env macro#40greenc-FNAL wants to merge 1 commit into
greenc-FNAL wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts cet_cmake_env() initialization behavior so GNUInstallDirs is processed at the time the environment is bootstrapped (and in the caller’s scope), rather than when Modules/CetCMakeEnv.cmake is merely included. This aligns module behavior with subproject/FETCHCONTENT use cases and addresses the scope-related output/install-directory issues described in #39.
Changes:
- Move
include(GNUInstallDirs)from file scope into thecet_cmake_env()macro. - Keep the developer-warning suppression around
GNUInstallDirsinclusion, but now applied at macro invocation time.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+107
to
+118
| # ############################################################################## | ||
| # See https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html. | ||
| # | ||
| # We suppress developer warnings for this `include()` to silence | ||
| # complaints from CMake >=4 when no `LANGUAGES` are enabled for this | ||
| # project. | ||
| set(_cce_suppress_dev_warnings "$CACHE{CMAKE_SUPPRESS_DEVELOP_WARNINGS}") | ||
| set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS ON CACHE INTERNAL "" FORCE) | ||
| include(GNUInstallDirs) | ||
| set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS "${_cce_suppress_dev_warnings}" CACHE INTERNAL "" FORCE) | ||
| unset(_cce_suppress_dev_warnings) | ||
| # ############################################################################## |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
include(GNUInstallDirs)call performs work that must beexecuted when
cet_cmake_env()is called, not merely when theCetCMakeEnv.cmakefile is included.Fixes #38, #39